package com.zidongxiangxi.clock.http.client;

import com.zidongxiangxi.clock.http.exception.ClockException;
import com.zidongxiangxi.clock.http.request.CreateClockRequest;
import com.zidongxiangxi.clock.http.request.DeleteClockRequest;
import feign.Headers;
import feign.Param;
import feign.RequestLine;

/**
 * 闹钟相关接口
 *
 * @author chenxudong
 * @date 2020/07/22
 */
public interface ClockClient {

    /**
     * 创建回调类型为rabbitMq的闹钟
     *
     * @param request 入参
     * @return 闹钟id
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @RequestLine("PUT /clocks")
    Long createClock(CreateClockRequest request) throws ClockException;

    /**
     * 删除闹钟
     *
     * @param request 入参
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @RequestLine("DELETE /clocks")
    void deleteClock(DeleteClockRequest request) throws ClockException;

    /**
     * 根据id删除闹钟
     *
     * @param clockId 闹钟id
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @RequestLine("DELETE /clock/{clockId}")
    void deleteClockById(@Param(value = "clockId") Long clockId) throws ClockException;
}
